package cn.com.surker.production.entity.vo;

import cn.com.surker.enums.ICodeDescEnum;
import cn.com.surker.enums.production.indent.ProTypeEnum;
import cn.com.surker.enums.sale.ContractCategoryEnum;
import cn.com.surker.excel.ExcelCell;
import cn.com.surker.lab.entity.LabExpendUpload;
import cn.com.surker.lab.entity.LabExpendUploadLine;
import cn.com.surker.production.entity.ProductionIndent;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * 任务单基础上多加了展示数据
 *
 * @author luotao
 * @date 2024/9/12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class ProductionIndentVo extends ProductionIndent {

	/**
	 * 合同编号
	 */
	private String conCode;

	/**
	 * 合同名称
	 */
	@ExcelCell(value = "工程名称", sort = 2)
	private String conName;
	/**
	 * 小票抬头
	 */
	private String receiptUnit;

	/**
	 * 客户名称
	 */
	@ExcelCell(value = "客户名称", sort = 2, childSort = 1)
	private String clientName;

	/**
	 * 客户编码
	 */
	private String clientCode;

	/**
	 * 合同类型1:商砼，2：砂浆，3：水稳层，4：全轻混凝土，5：预制件合同)
	 */
	private Integer contractCategory;

	private String conCategoryTxt;

	public String getConCategoryTxt() {
		if (this.contractCategory == null) {
			return "";
		}
		ContractCategoryEnum anEnum = ICodeDescEnum.getEnum(ContractCategoryEnum.class, this.contractCategory);
		if (anEnum == null) {
			return "";
		}
		conCategoryTxt = anEnum.getDescription();
		return conCategoryTxt;
	}

	/**
	 * 销售人员
	 */
	private String sales;
	/**
	 * 销售电话
	 */
	private String salesPhone;

	/**
	 * 前场工长电话
	 */
	private String foremanPhone;

	/**
	 * 施工单位
	 */
	private String builder;

	/**
	 * 强度等级名
	 */
	@ExcelCell(value = "砼强度", sort = 4)
	private String strengthName;

	/**
	 * 浇筑方式名
	 */
	@ExcelCell(value = "浇筑方式", sort = 7)
	private String castModelName;

	/**
	 * 泵送设备id,多个用逗号隔开
	 */
	private String pumpDeviceIds;

	/**
	 * 泵送设备名,多个用逗号隔开
	 */
	private String pumpDeviceName;

	/**
	 * 泵送类型名
	 */
	private String pumpTypeName;

	/**
	 * 泵送规格名
	 */
	private String pumpNormName;

	/**
	 * 是否上传配合比
	 */
	private Integer labExpend;
	/**
	 * 微信订单是否可以修改 0不可修改，1可修改
	 */
	private Integer isChange;

	private List<ProductionInvoiceVo> invoiceList;
	/**
	 * 任务单上传的生产线
	 */
	private List<LabExpendUpload> expendUploadLines;

	private String typeTxt;

	public String getTypeTxt() {
		Integer type = this.getType();
		ProTypeEnum anEnum = ICodeDescEnum.getEnum(ProTypeEnum.class, type);
		if (anEnum != null) {
			typeTxt = anEnum.getDescription();
		}
		return typeTxt;
	}
}
